n = float(input())
def pi(number):
    num = 0
    j = 1
    i = 0
    while True:
        if i%2==0:
            num = num + 1/j
        else:
            num = num - 1/j
        j = j + 2
        i = i+1
        if 1/j<=number:
            break
    return num
print(f'{pi(n)*4:.8f}')